﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Layouts/Administration.Master" Inherits="System.Web.Mvc.ViewPage<FacialClub.Helpers.PaginatedListCollection<FacialClub.Models.Entities.EmailTemplate>>" %>
<%@ Import Namespace="FacialClub.Helpers" %>
<%@ Import Namespace="MvcPaging" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Index </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <h2>Email Template Listing</h2>
  <% if (ViewData.Model.Count > 0) { %>
  <p> Found <%= ViewData.Model.TotalCount %> items. </p>
  <table width="100%">
    <tr align="left">
      <th align="left"> ID </th>
      <th> EmailTemplateName </th>
      <th> IsVisible </th>
      <th> CreatedOn </th>
      <th>Actions</th>
    </tr>
    <% foreach (var item in Model) { %>
    <tr>
      <td><%: item.EmailTemplateId %>
      </td>
      <td><%: Html.ActionLink(item.EmailTemplateName, "Details", new { id=item.EmailTemplateId }) %>
      </td>
      <td><%: (item.IsVisible == true) ? "Yes" : "No" %>
      </td>
      <td><%: String.Format("{0:g}", item.CreatedOn) %>
      </td>
      <td><%: Html.ActionLink("Edit", "Edit", new { id=item.EmailTemplateId }) %>
        |
        <%: Html.ActionLink("Delete", "Delete", new { id = item.EmailTemplateId }, new { onclick = "return confirm(‘Are you sure you wish to delete this module?’);" })%>

      </td>
    </tr>
    <% } %>
  </table>
  <% } %>
  <div class="pager"> <%= Html.Pager(ViewData.Model.PageSize, ViewData.Model.PageIndex+1, ViewData.Model.TotalCount )%> </div>
   <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
<script type="text/javascript">
$( function() {
$('.button-delete').click(function() {
return confirm('Are you sure you wish to delete this item?');
});
});
</script>
<script type="text/javascript">
    function confirmDelete() {
        return confirm("You are about to delete this record. This is permananent. Are ABSOLUTELY sure?");
    }
</script>
 </asp:Content>
